Skip to content

Conversation

@orware
Copy link
Contributor

@orware orware commented Nov 26, 2025

This should help to address an issue that was reported where if a -schema.sql file contains extra SQL comments at the end after the CREATE TABLE query the table would get dropped right after creation if using the --overwrite-tables flag.

This adjusts the logic so the DROP TABLE only occurs once, and should also allow for the -schema.sql file to ignore SQL comment lines.

The changes should also allow for extra ALTER TABLE queries, if present, to be processed successfully.

Separately, some related tests have been added in to go with the changes.

Adjusts the drop table logic so it occurs only once.

Adds line comment filtering since a few line comments followed by an `ALTER TABLE` statement could be excluded using simpler skip logic for empty queries.

Improved the show details output as well as it runs through any additional queries that may be present in the `-schema.sql` files, although in the majority of cases the files should only contain the single `CREATE TABLE` query.
These extra tests should help to avoid a regression for what issue 1462 reported.
@orware orware requested a review from a team as a code owner November 26, 2025 22:01
Copy link

@doncovski doncovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran tests with local build and it passed properly as intended

@mscoutermarsh mscoutermarsh merged commit 0504c16 into main Nov 28, 2025
2 checks passed
@mscoutermarsh mscoutermarsh deleted the issue-1462 branch November 28, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants